#include "Canvas.h"
#include "ToolFactory.h"




 void Canvas::setCurrentTool(QString tool)
	{Canvas::currentTool = tool;}
Canvas::Canvas(QGraphicsPixmapItem *pixmap, QWidget* parent = 0 ) :QGraphicsScene(parent)
{
//	currentPixmap = pixmap;
//	this->addItem(pixmap);
}

QString getCurrentTool();



void Canvas::setImage(QImage sourceImage)
{
theImage = sourceImage;
if(currentPixmap == NULL)
{
	currentPixmap = new QGraphicsPixmapItem(QPixmap::fromImage(sourceImage));
	this->setSceneRect(QPixmap::fromImage(sourceImage).rect());
	this->addItem(currentPixmap);
}
else
	currentPixmap->setPixmap(QPixmap::fromImage(sourceImage));
this->addItem(currentPixmap);
this->update();
}


